<!doctype html public "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Trim Avisynth Filter</title>
<link rel="stylesheet" type="text/css" href="../../avisynth.css">
</head>
<body>
<h2>Trim</h2>
<p><code>Trim </code>(<var>clip, int first_frame, int last_frame [, bool pad_audio]</var>)</p>
<p><code>Trim</code> trims a video clip so that it includes only the frames <var>first_frame</var>
  through <var>last_frame</var>. The audio is similarly trimmed so that it stays synchronized.
  If you pass <tt>0</tt> for <var>last_frame</var> it means "end of clip." A negative value of
  last_frame returns the frames from <var>first_frame</var> to
  <var>first_frame</var> + (- <var>last_frame</var>-1). This is the only way to get the
  very first frame!</p>
<p><var>pad_audio </var>(default true) causes the audio stream to be padded to align
  with the video stream. Otherwise the tail of a short audio stream is left so. When
  last_frame=0 and pad_audio=false the end of the two streams remains independant.</p>
<pre>Trim(100,0)         # delete the first 100 frames, audio padded
                    # or trimmed to match the video length.
Trim(100,0,false)   # delete the first 100 frames of audio and video,
                    # the resulting stream lengths remain independant.
Trim(100,-100)      # is the same as trim(100,199)
Trim(100,199,false) # audio will be trimmed if longer but not
                    # padded if shorter to frame 199
Trim(0,-1)          # returns only the first frame</pre>
<p><b>Changelog:</b></p>
<table border="1">
  <tbody>
    <tr>
      <td>v2.56</td>
      <td>added pad audio</td>
    </tr>
  </tbody>
</table>
<p><kbd>$Date: 2005/10/03 16:49:04 $</kbd></p>
<FORM>
<INPUT TYPE="Button" VALUE="Back"
onClick="history.go(-1)">
</form>
</body>
</html>
